package com.nuoniu.sibanyun.entity.production;

import com.baomidou.mybatisplus.annotation.FieldStrategy;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.nuoniu.sibanyun.common.BaseEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import java.math.BigDecimal;
import java.time.LocalDate;

/**
 * <p>
 * 生产领退补料单明细
 * </p>
 *
 * @author 小啊刚
 * @since 2021-02-28
 */
@Data
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@TableName("ma_picking_return_rep_detail")
@ApiModel(value="VProductionPickReturnDetail对象", description="生产领退补料单明细")
public class VProductionPickReturnDetail extends BaseEntity {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "公司id")
    @TableField("company_id")
    private Integer companyId;

    @ApiModelProperty(value = "账套id")
    @TableField("account_id")
    private Integer accountId;

    @ApiModelProperty(value = "主id")
    @TableField("order_id")
    private Integer orderId;

    @ApiModelProperty(value = "生产订单号")
    @TableField("production_order_code")
    private String productionOrderCode;


    @ApiModelProperty(value = "物料id")
    @TableField("inventory_id")
    private Integer inventoryId;

    @ApiModelProperty(value = "物料名称")
    @TableField("inventory_name")
    private String inventoryName;

    @ApiModelProperty(value = "物料编码")
    @TableField("inventory_code")
    private String inventoryCode;

    @ApiModelProperty(value = "规格型号")
    @TableField("inventory_specification")
    private String inventorySpecification;

    @ApiModelProperty(value = "材料供应商id")
    @TableField("vendor_id")
    private Integer vendorId;

    @ApiModelProperty(value = "材料供应商名称")
    @TableField("vendor_name")
    private String vendorName;

    @ApiModelProperty(value = "仓库id")
    @TableField("warehouse_id")
    private Integer warehouseId;

    @ApiModelProperty(value = "仓库名称")
    @TableField("warehouse_name")
    private String warehouseName;

    @ApiModelProperty(value = "工作中心id")
    @TableField("work_center_id")
    private Integer workCenterId;

    @ApiModelProperty(value = "工作中心编码")
    @TableField("work_center_code")
    private String workCenterCode;

    @ApiModelProperty(value = "工作中心")
    @TableField("work_center_name")
    private String workCenterName;

    @ApiModelProperty(value = "工序id")
    @TableField("work_procedure_id")
    private Integer workProcedureId;

    @ApiModelProperty(value = "工序名称")
    @TableField("work_procedure_name")
    private String workProcedureName;

    @ApiModelProperty(value = "生产线id")
    @TableField("production_line_id")
    private Integer productionLineId;

    @ApiModelProperty(value = "生产线名称")
    @TableField("production_line_name")
    private String productionLineName;

    @ApiModelProperty(value = "生产批号")
    @TableField("batch_no")
    private String batchNo;

    @ApiModelProperty(value = "业务类型来源")
    @TableField("business_type_source")
    private Integer businessTypeSource;

    @ApiModelProperty(value = "计划跟踪号")
    @TableField("plan_track_number")
    private String planTrackNumber;

    @ApiModelProperty(value = "备注")
    @TableField("remarks")
    private String remarks;

    @ApiModelProperty(value = "存货分类ID")
    @TableField("inventory_category_id")
    private Integer inventoryCategoryId;

    @ApiModelProperty(value = "存货分类名称")
    @TableField("inventory_category_name")
    private String inventoryCategoryName;

    @ApiModelProperty(value = "对应产品id")
    @TableField("product_id")
    private Integer productId;

    @ApiModelProperty(value = "对应产品名称")
    @TableField("product_name")
    private String productName;

    @ApiModelProperty(value = "对应产品编码")
    @TableField("product_code")
    private String productCode;

    @ApiModelProperty(value = "加工产品规格")
    @TableField("product_specification")
    private String productSpecification;

    @ApiModelProperty(value = "单计量ID")
    @TableField("unit_id")
    private Integer unitId;

    @ApiModelProperty(value = "计量单位组ID")
    @TableField("unit_group_id")
    private Integer unitGroupId;

    @ApiModelProperty(value = "主计量ID")
    @TableField("base_unit")
    private Integer baseUnit;

    @ApiModelProperty(value = "主计量名称")
    @TableField("base_unit_name")
    private String baseUnitName;

    @ApiModelProperty(value = "数量（主计量）")
    @TableField("base_quantity")
    private BigDecimal baseQuantity;

    @ApiModelProperty(value = "辅计量ID")
    @TableField("sub_unit")
    private Integer subUnit;

    @ApiModelProperty(value = "辅计量名称")
    @TableField("sub_unit_name")
    private String subUnitName;

    @ApiModelProperty(value = "数量（辅计量）")
    @TableField("sub_quantity")
    private BigDecimal subQuantity;

    @ApiModelProperty(value = "可用量")
//    @TableField("available_quantity")
    private BigDecimal availableQuantity;

    @ApiModelProperty(value = "现存量")
//    @TableField("existing_quantity")
    private BigDecimal existingQuantity;

    @ApiModelProperty(value = "换算率")
    @TableField("unit_exchange_rate")
    private BigDecimal unitExchangeRate;

    @ApiModelProperty(value = "单价")
    @TableField("price")
    private BigDecimal price;

    @ApiModelProperty(value = "金额")
    @TableField("amount")
    private BigDecimal amount;


    @ApiModelProperty(value = "来源单据")
    @TableField("source_voucher_id")
    private Integer sourceVoucherId;

    @ApiModelProperty(value = "来源单据号")
    @TableField("source_voucher_code")
    private String sourceVoucherCode;

    @ApiModelProperty(value = "来源单据")
    @TableField("source_voucher_type")
    private String sourceVoucherType;

    @ApiModelProperty(value = "来源单据日期")
    @TableField("source_voucher_date")
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd" )
    private LocalDate sourceVoucherDate;

    @ApiModelProperty(value = "自定义字段数据")
    @TableField("define_fields")
    private String defineFields;

    @ApiModelProperty(value = "来源明细ID")
    @TableField("source_detail_id")
    private Integer sourceDetailId;

    @ApiModelProperty(value = "来源加工单ID")
    @TableField("source_production_work_id")
    private Integer sourceProductionWorkId;

    @ApiModelProperty(value = "来源派工ID（20210710废弃字段，后续删除）")
    @TableField("source_production_dispatch_id")
    private Integer sourceProductionDispatchId;

    @ApiModelProperty(value = "来源材料明细ID")
    @TableField("source_work_inventory_detail_id")
    private Integer sourceWorkInventoryDetailId;

    @ApiModelProperty(value = "累计退货数量（普通退货）")
//    @TableField("cum_ret_quantity")
    @TableField(exist = false)
    private BigDecimal cumRetQuantity;

    @ApiModelProperty(value = "累计退货情况（普通退货）")
//    @TableField("cum_ret_json")
    @TableField(exist = false)
    private String cumRetJson;

    @ApiModelProperty(value = "累计执行数量")
    @TableField(exist = false)
    private BigDecimal cumExecuteQuantity;

    @ApiModelProperty(value = "累计执行情况")
    @TableField(exist = false)
    private String cumExecuteJson;




}
